#ifndef CLIENT_H
#define CLIENT_H

#include <QDebug>
#include <QObject>
#include <QtNetwork/QUdpSocket>
#include <QDataStream>
#include <QtNetwork/QtNetwork>
#include <QtNetwork/QNetworkInterface>
#include <QList>
#include <QTimer>
#include <QEventLoop>
#include <QString>

#include "Settings.h"
#include "QPcap.h"
#include "mainwindow.h"

class Client : public QObject
{
    Q_OBJECT
public:
    explicit Client(Settings * settings, MainWindow * window, QObject * parent = 0);
    ~Client();

    void stop();

    void start();

    QPcap * getQpcapThread();

    void usePacket(QPcapPacket * packet);

private:
    MainWindow  * window;
    Settings * settings;
    QPcap * qPcapThread;
    QList<unsigned short> * opCodeRecieved;
signals:
    void signalLog(QString content, QColor color = QColor());
    void signalLog(QString title, QString content, QColor colorTitle = QColor(), QColor colorText = QColor());
    void signalSetStatusBar(QString text, int time = 100000);

public slots:
    void slotGetPacket(QPcapPacket * packet);

};

#endif // CLIENT_H
